var nextTest = this.notStarted.shift();
this.running.push(nextTest);
this.running.remove(nextTest);
var newState = nextTest.state();
newState === TestCase.State.Succeeded ? this.succeeded :
newState === TestCase.State.Failed ? this.failed :
var targetCollectionArray = targetCollection();
for (var i = targetCollectionArray.length - 1; i >= 0; i--) { var t = targetCollectionArray[i];
if (nextTest.name > t.name) { targetCollection.splice(i + 1, 0, nextTest);
targetCollection.unshift(nextTest);
private _loadTests(namespace: any) { var byName: { [name: string]: TestCase; } = {}; var names: string[] = [];
TestPage.forEachTest(namespace, (name, _this_, test) => { if (name.indexOf(this._urlHash) < 0)
if (namespace && (namespace + '.' + name).indexOf(this._urlHash) < 0)
if (namespace && (namespace + name).indexOf(this._urlHash) < 0)
var testCase = new TestCase(name, _this_, test);
var testCase = byName[name];
this.notStarted(this.all);
static forEachTest(namespace: any, callback: (name: string, _this_: any, test: () => void) => void) { for (var k in namespace) { if (!k || k.charAt(0) === '_' || Object.prototype[k]) continue;
if (typeof t === 'function') { for (var k in t.prototype) { if (!k || Object.prototype[k]) continue;
(name, _this_, test) => callback(k + '.' + name, _this_, test));
callback(k, namespace, t);
else if (typeof t === 'object') { (name, _this_, test) => callback(k+'.'+name, _this_, test));